package com.jims.api.v1.controller.weixin;


import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/10/23.
 */
public class Test {

    public static void main(String[] args) throws Exception {
       /* HttpServletRequest request;*/
        /*MyConfig config = new MyConfig();
        WXPay wxpay = new WXPay(config);

        Map<String, String> data = new HashMap<String, String>();
        data.put("body", "腾讯充值中心-QQ会员充值");
        data.put("out_trade_no", "2017122710595900000012");
        data.put("device_info", "WEB");
        data.put("fee_type", "CNY");
        data.put("total_fee", "1");
        data.put("spbill_create_ip", "");//request.getRemoteAddr()
        data.put("notify_url", "http://weixin.ch-groups-slyy.com/payg.jsp");
        data.put("trade_type", "JSAPI");  // 此处指定为扫码支付
        data.put("product_id", "12");
        data.put("appid", "wxad96e851b422b222");
        data.put("openid", "oOCiys-4Ljrs3oX10DiYA8mM6imA");
        data.put("mch_id", "1494886542");
        String sign = WXPayUtil.generateSignature(data,config.getKey());
        data.put("sign", sign);
        try {
            //统一下单接口
            Map<String, String> resp = wxpay.unifiedOrder(data);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }*/
       /* try {
            Map<String, String> resp = wxpay.microPay(data);//unifiedOrder
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }
}
